package com.neu.fenli2023623.service.impl;

import com.neu.fenli2023623.dto.HealthEncyclopediaDto;
import com.neu.fenli2023623.entity.HealthEncyclopedia;
import com.neu.fenli2023623.mapper.HealthEncyclopediaMapper;
import com.neu.fenli2023623.service.HealthEncyclopediaService;
import com.neu.fenli2023623.vo.HealthEncyclopediaVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class HealthEncyclopediaServiceImpl implements HealthEncyclopediaService {
    @Autowired
    private HealthEncyclopediaMapper healthEncyclopediaMapper;
    @Override
    public List<HealthEncyclopediaVo> quaryall() {
        return healthEncyclopediaMapper.selectall();
    }

    @Override
    public int addHealthEncyclopedia(HealthEncyclopediaDto record) {
        return healthEncyclopediaMapper.insert(record);
    }

    @Override
    public int deleteHealthEncyclopediaByPrimaryKey(Long id) {
        return healthEncyclopediaMapper.deleteByPrimaryKey(id);
    }

    @Override
    public List<HealthEncyclopedia> selectByName(String name) {
        return healthEncyclopediaMapper.selectByName(name);
    }

    @Override
    public HealthEncyclopedia selectHealthEncyclopediaByPrimaryKey(Long id) {
        return healthEncyclopediaMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateHealthEncyclopediaByPrimaryKey(HealthEncyclopediaDto record) {
        return healthEncyclopediaMapper.updateByPrimaryKey(record);
    }
}
